import {
	Api
} from '@/common/api'
import {
	ApiBase
} from '@/common/api-base.js';

class dictDataClass extends ApiBase {
	getDicts(dictType) {
        let requestUrl='/system/dict/data/type/' + dictType
          if(uni.getStorageSync('hospital')){
            let hospObj=JSON.parse(uni.getStorageSync('hospital'))
            let hospitalId=hospObj.deptId
            if(hospitalId&&hospObj.ancestors.split(',').length != 1){
              if(dictType=='sys_picking_location'||dictType=='sys_treatment_reaction'
              ||dictType=='sys_patient_reason'||dictType=='sys_face_part'||dictType=='sys_treatment_parameter'){
                requestUrl='/system/dict/data/type/' + dictType+'/'+hospitalId
              }
            }
          }
		return Api.get(requestUrl);
	}
	
	
}

export const dictDataApi = new dictDataClass('/system')
